package com.kaoyaya.delivery.adapter;

import java.util.List;

import com.kaoyaya.delivery.fragment.SideBarItem;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

public class SideBarAdapter extends BaseAdapter{
	
	private List<SideBarItem> sideBarItems;
	
	public SideBarAdapter(List<SideBarItem> sideBarItems) {
		this.sideBarItems = sideBarItems;
	}

	@Override
	public int getCount() {
		return sideBarItems.size();
	}

	@Override
	public SideBarItem getItem(int position) {
		return sideBarItems.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		if (convertView == null) {
			convertView = getItem(position).getView();
		}
		return convertView;
	}

}
